/*
 ============================================================================
 Name		: FbInformation.h
 Author	  : HeQun
 Version	 : 1.0
 Copyright   : Copyright.2009
 Description : CFbInformation declaration
 ============================================================================
 */

#ifndef FBINFORMATION_H
#define FBINFORMATION_H

// INCLUDES
#include <coecntrl.h>

// CLASS DECLARATION


//#define USE_LABEL 0
//#define USE_RICHTEXT 0
/**
 *  CFbInformation
 * 
 */
class CFbInformation : public CCoeControl
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CFbInformation();

	/**
	 * Two-phased constructor.
	 */
	//static CFbInformation* NewL(TInt aTitleResId, TInt aContentResId, const TRect& aRect, CCoeControl& aParent);
	static CFbInformation* NewL(TInt aTitleResId, const TDesC& aFilename, const TRect& aRect, CCoeControl& aParent);

	/**
	 * Two-phased constructor.
	 */
	//static CFbInformation* NewLC(TInt aTitleResId, TInt aContentResId, const TRect& aRect, CCoeControl& aParent);
	static CFbInformation* NewLC(TInt aTitleResId, const TDesC& aFilename, const TRect& aRect, CCoeControl& aParent);

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CFbInformation();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	//void ConstructL(TInt aTitleResId, TInt aContentResId, const TRect& aRect, CCoeControl& aParent);
	void ConstructL(TInt aTitleResId, const TDesC& aFilename, const TRect& aRect, CCoeControl& aParent);
	
	/**
	* From CoeControl,SizeChanged.
	*/
	void SizeChanged();

	/**
	* From CoeControl,CountComponentControls.
	*/
	TInt CountComponentControls() const;

	/**
	* From CCoeControl,ComponentControl.
	*/
	CCoeControl* ComponentControl(TInt aIndex) const;

	/**
	* From CCoeControl,Draw.
	*/
	void Draw(const TRect& aRect) const;
	
	//Load Text String From resource!
	//void LoadStringsFromResourceL(TInt aTitleResId, TInt aContentResId);
	void LoadStringsFromResourceL(TInt aTitleResId, const TDesC& aFilename);
	
public:
	/**
	 * From CoeControl,
	 * 按键事件接收处理
	 */
	TKeyResponse OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType );

	//Surport to set title and content!
	void SetTitleStringsL(const TDesC& aTitle);
	
	void SetContentStringsL(const TDesC& aContent);
	
private:
	//Data
	HBufC* m_TitleBuf;
	HBufC* m_ContentBuf;
	
	TBool m_IsShowDiskInfo;//显示磁盘信息
	
	//Logo Image
	CFbsBitmap *m_pAppLogoBmp;
	
	//TDes EnCodeString(TDes &inStr);

	};

#endif // FBINFORMATION_H
